Magnetic data interpretation for 2D dikes by the metaheuristic bat algorithm: sustainable development cases

Metaheuristic algorithms are increasingly being utilized as a global optimal method in the inversion and modeling of magnetic data. We proposed the Bat Algorithm Optimization (BAO) technique that is based on bat echolocation performance to find the global optimum solution. The best-estimated source parameters that correspond to the objective function minimum value are obtained after achieving the global optimum (best) solution. The suggested BAO technique does not require any prior knowledge; rather, it is a global search method that provides an effective tool for scanning the space of data to appraise sources parameters. The BAO technique is applied to magnetic data in the class of dipping and vertical dikes along 2D profiles to estimate the dimensional source parameters that include the depth to top, origin location, amplitude coefficient, index angle of magnetization, and width of the dipping dikes. The BAO technique has been used for single and multiple dikes structures. The accuracy and stability of the BAO technique are achieved on different synthetic examples of free and noisy data for single and multiple cases. Furthermore, the presented BAO technique was effectively utilized in three field examples from China and Egypt for iron ore deposits and metavolcanics basalt rock investigations. Overall, the BAO technique recovered inversion outcomes are in good agreement with borehole, geology, and published literature results.


Bat algorithm optimization (BAO). The Bat Algorithm Optimization (BAO) is a nature-inspired
metaheuristic optimization technique and was first introduced mathematically by Yang 66 . It depends on the echolocation characteristic of microbats. Microbats use echolocation in the dark to identify their nest, avoid obstacles, and track prey. Bats produce a loud sound pulse in the range of 8-10 kHz and listen for echoes from nearby objects. Each pulse lasts only a few milliseconds (up to about 8 to 10 ms). When bats are approaching prey or an item, their pulse rate increases, but their sound loudness falls 66 . So, the echolocation activity of microbats may be represented in a way that maximizes or optimize objective functions. In brief, the key rules of the global optimizing bat algorithm are: (1) Bats use echolocation to determine distance; (2) Bats detect their sources by flying at a specified frequency range [Q min , Q max ] with an initial velocity of (V i ) at position (X i ); and (3) the loudness (L i ) and the pulse emission rate, (r i ), which vary relied on the space or distance amongst the target object and the bat.
The frequency range [Q min , Q max ] is referred to by the wavelength spectrum [K min , K max ]. As a result, in an optimization problem, changing the frequency or wavelength may be utilized to vary the movement range of bats (Eqs. [1][2][3]. As a result, selecting the appropriate frequency or wavelength range is critical, and it should be selected to fit the scale of the interest region before toning down to lower ranges. The spectrum of [0, 5] was calculated as the optimal frequency range in this inquiry after executing the technique with varied settings (Fig. 1). The pulse rate, r i , can range from 0 to 1, with 0 denoting no pulses and 1 denoting the highest pulse emission rate. Furthermore, the initial loudness, i.e., L i , might often be in the 1,2 range 66 . As the bats get closer to their target, their loudness drops but their pulse emission rate rises. The algorithm updates the rate of emission and the loudness of the bats when a new solution is improved, implying that the bats are reaching the best solution (Eqs. [4][5] 67 . The effects of the optimizing parameters of the frequency (Q i ), Loudness (L i ), and rate of pulse emission (r i ) on the rate of BAO approach convergence were studied ( Fig. 1) using different ranges of each parameter. The influence of each set of (Q i , L i , and r i ) parameters on the convergence rate and behavior is shown in Fig. 1. Figure 1 suggests that the optimum set has Q 1 = [0, 5], L 1 = 1.0 and r 1 = 0.9, which has a minimum NRMSE of the objective function than other sets and gives a fast convergence to the optimum solution.
The performance of the BAO code to obtain the optimal model parameters of the assumed model (i.e. Numerical model-1) have been measured using the MATLAB function "tic & toc" to measure the wall-clock time, it takes about 41 s on simple PC. This result indicates that the fastest performing of BAO algorithm compared with the other metaheuristic algorithms such as particle swarm optimization (PSO), cuckoo search algorithm (CS), and artificial bee colony algorithm (ABC) 68 . This characteristic of BAO can be attributed to the parameter tuning features.
The following are the equations that show the link between algorithm parameters 66 : where, Q i represents the spectrum frequency of i th bat which is updated in every iteration process, β represents a uniformly random vector in the range [0, 1] and X best represent the current global best solution through all numbers of the bats, α and γ are constants, 0 < α < 1 and γ > 0 and τ is the scaling factor. The BAO approach utilizes a random path to produce new results from every chosen best solution in the local search, as follows: where ε ∈ [-1, 1] represents a random number, and L t is the average loudness of all number of the bats at the current process.
Generally, in respect of accuracy and performance, the BAO approach outperforms most other algorithms. The global optimizing bat algorithm becomes a normal PSO when the frequency perturbations are replaced with a random parameter when L i = 1 and r i = 1 are set. Similarly, by substituting the velocities with constant loudness and pulse rate, the BAO approach is reduced to a basic harmony search algorithm.

Methodology
Magnetic forward modeling. The total magnetic anomaly effect (T) at a stationary point (x j ) along profile due to a 2D dipping dike of infinite strike length, semi-infinite depth extension, and uniformly magnetization (Fig. 2a) is provided by 17,30,69 :  www.nature.com/scientificreports/ where x j and x o represent the profile distance (m) of the stationary points and the origin of the covered source ( Fig. 2a), z is the depth to the top of the dipping dike (m) (Fig. 2a), θ is the index parameter angle (degrees), d denotes the half width of the dipping dike (m), K is the amplitude coefficient (nT), and n represents the data point numbers along with the profile. The general formula for a magnetic anomaly (T) due to thin vertical dike (total, horizontal or vertical fields) (Fig. 2b) is provided by 29,70,71 : where x j and x o are the stations along the profile and the origin of the hidden source structure (m) (Fig. 2b), z represents the depth to the top of the vertical thin dike (m) (Fig. 2b), θ is the index parameter angle (degrees), K is the amplitude coefficient (or effective magnetization intensity) (nT), and n represents the data point numbers.
Inversion process. It's critical to have precise findings for the subsurface model parameters while assessing magnetic data to match the observed data. As a result, a high-capacity inversion technique was required to accurately estimate subsurface model parameters (depth, position, and form of the buried anomalous body, among other things). Metaheuristic inversion techniques are beneficial in several case studies. In comparison to metaheuristic inversion algorithms, traditional inversion approaches are more complex, time-consuming, and inefficient.
In this work, we propose an approach to invert magnetic data based on Yang (2010). The depth (z), location (x o ), index angle (θ), half width (d), and amplitude coefficient (K), are the primary essential characteristics factors that describe the magnetic data anomaly due to dike model. As a result, these factors are investigated in the proposed BAO inversion method to establish a subsurface model that matches the real ones.  www.nature.com/scientificreports/ The placement of each bat in the search space implies a solution. Bats fly randomly in search space and apply a solution in each iteration step. The point with the lowest misfit of the NRMSE of the objective function determines the ideal best solution (X best ). This technique is carried out a certain number of times. The X best is picked as the best response after the final iteration. In this study, the BAO inversion program was established and tested on various numerical cases and real-world datasets.
The process steps that make up the proposed BAO methodology for inverting magnetic data consist of the following: (1) The virtual bats' initial position X i (i = 1, 2, 3,…, N), frequency Q i , velocity V i , loudness L i , and pulse rates of emission r i are as follows: In the search space, each bat characterizes a potential solution. The distinctive source parameters (i.e,. z, x o , d, and K) are randomly chosen from the search space to represent the variable X i , while V i represents the velocity for every unique virtual bat. (2) Determining the X best : The objective function (Ω) is defined as the NRMSE between measured and calculated magnetic data anomalies and is also known as the misfit function. It is a crucial component of any optimization and varies based on the issue type. For the interpretation of magnetic data confined to basic geometric shapes (e.g., dipping dike and vertical thin sheet models), the following misfit objective function (Ω) between observed and model response has been applied: where N is the number of data points, T Obs denotes the magnetic data observed, and T Cal denotes the calculated magnetic model response. The forward modeling approach may be used to compute T Obs . The misfits are first evaluated using Eq. (9), and the bat with the lowest misfit is picked as the X best .
(3) Run the following instructions while the program is still iterating for the maximum amount of iterations: • To create a new solution, adjust the frequency spectrum (Eq. 1), update the velocities, and position/ solutions (Eqs. 2 and 3).
• choose a solution amongst the best solution.
• build a local solution around the chosen best solution (Eq. 6).
• end if • if rand < L i and Ω (X i ) < Ω (X best ).
• accept the new solutions.   (Fig. 5a). The measured data that has to be evaluated is represented by this anomalous response. Following the processes outlined in Sect. 2 of the BAO approach, the average bat loudness vs. iteration numbers is shown in Fig. 5b.
The average bat loudness vs. iteration numbers is shown in Fig. 5b. The number of iterations is determined by estimating the objective function's minimum NRMSE and achieving the optimal magnetic anomaly response solution (Fig. 5a). Figure 5c depicts the emission rat created by the bats throughout each iteration step, showing that as the bats come closer to their goal, their loudness lowers but their pulse emission rate rises. Figure 5d displays the NRMSE of the global best solution (i.e., min objective function, Ω) vs the iteration numbers, which demonstrates that after 300 iterations, it approaches the min for all bat numbers. For each iteration phase, Fig. 5e displays the average NRMSE of all the bats. www.nature.com/scientificreports/ The global optimal solution of the magnetic anomaly response (i.e., the model parameters of the model) is achieved when the objective function (Ω) approaches the minimum of the NRMSE during the iteration operation. Table 1 provides that the recovered model parameters of the noise free numerical example are equal to the actual model parameters when the objective functions (Ω) approach the minimum. This means that the BAO technique used is accurate, stable, and capable of recovering the real values of the model parameters. In addition, Table 1 shows search space and relative errors (RE) for each model parameter.
To check the stability of the proposed BAO approach, we have introduced two different kinds of noise, the random Gaussian noise (RGN) and the additive white Gaussian noise (AWGN) to the noise-free data presented in Fig. 5a using a noise percentage of 15%. By applying the aforementioned procedures of the BAO approach to the noisy data anomalies, the best obtained model parameter of the recovered model will be corresponding to the minimum NRMSE of the objective functions (Ω). Figure 6 shows the noisy contaminated magnetic anomaly after adding the 15% RGN (I) and 15% AWGN (II) to the data presented in Fig. 5a, respectively as the calculated magnetic response after obtaining the best model parameters using the BAO inversion approach (Panel a). The loudness, emission rate, the NRMSE of the global best solution (Ω), and the average NRMSE of all the bats are shown in panels (b), (c), (d), and (e) of Fig. 6, respectively. Table 2 shows the corresponding recovered model parameters of the noisy numerical examples for introduced noise types (RGN and AWGN). The obtained results show that the recovered model parameters are not significantly affected by the intruding noise and are close to the true ones. Also, Table 2 illustrates the RE corresponding to each obtained model parameter for each kind of noise (RGN and AWGN). It can be concluded that the BAO approach proposed here is stable to the two introduced types of noises.
To further check the stability of the proposed method with respect to the amount of noises, we have increased the percentage of noise to 20% for both the kind of noises (RGN & AWGN) and reprocess the same procedure of the BAO approach to the synthetic noisy anomalies. Table 3 shows the recovered model parameters for the 20% noisy numerical examples for both kinds of noise (RGN and AWGN). The obtained results show that the recovered parameters are still having good results in the presence of the 20% of noise for the both kinds (RGN and AWGN). Also, Table 3 illustrates the RE corresponding to each obtained model parameter for each kind of noise in case of 20% noise amount. Finally, it can be concluded that the BAO approach anticipated here is stable with respect to noise types and amounts for 2D dipping dike model case.
Numerical Model-2. To further investigate the BAO algorithm for studying the geological structures, a noise-free example of a vertical dike (or thin sheet) model has been investigated (model b) (Fig. 2). The magnetic anomaly of the vertical dike model K = 1500 nT, z = 7 m, x o = 0 m and θ = -65 ̊ is calculated using Eq. (8) for a 201-m long profile (Fig. 7a). Applying the same procedure of the BAO algorithm described above. The computed magnetic response of the vertical dike model is shown in Fig. 7a. The average loudness of the magnetic anomaly is shown in Fig. 7b, and the emission rate of the bat is obtained in Fig. 7c. The NRMSE of the global best solution (min objective function, Ω) is shown in Fig. 7d, and the average NRMSE of all the bats is shown in Fig. 7e. Table 4 shows that the recovered model parameters of the vertical dike model are extremely identical to the actual one. The result supports that the BAO algorithm can be used to investigate the geological structure, like vertical dikes or thin sheets. In addition, Table 4 illustrates the RE of each recovered model parameter.
Moreover, Fig. 7a is contaminated with the two different kinds of noises mentioned above RGN and AWGN (Fig. 8a). The best model parameter of the recovered model will be corresponding to the minimum NRMSE of the objective functions (Ω). Figure 8 shows the contaminated magnetic anomaly response and the calculated magnetic response after obtaining the best model parameters using the BAO inversion approach (Panel a). The   Fig. 8, respectively. Table 5 shows that the recovered model parameters of the contaminated magnetic anomaly responses (i.e., corresponding to min Ω) are not significantly affected by the noisy 15% of both noise, and they are significantly close to the true ones. Therefore, the BAO approach suggested here is stabilized to the different kind of noises that have been introduced. The RE of the recovered model parameters for both noise types is illustrated in Table 5.
In order to test the stability of the suggested approach further with regard to the quantity of noises for the vertical dike model case, we have raised the proportion of noise to 20% for both the type of noises (RGN & AWGN) and reapplied the same procedure of the BAO approach to the noisy data anomalies. The recovered model parameters are displayed in Table 6 for the 20% noisy numerical examples for both types of noise (RGN and AWGN). The collected findings demonstrate that the recovered parameters still perform well when there is 20% noise for both types of noise (RGN and AWGN). Additionally, Table 6 shows the RE for each calculated  Numerical model-3. Interference affects the targets due to nearby multiple structures and also has an impact on the observed magnetic data. Therefore, we calculated the composite magnetic response (using Eqs. 7 and 8) for two neighboring source structures, called vertical dike (or thin sheet) model with true model param-  www.nature.com/scientificreports/    (Fig. 9a) to check the impact of this multiple source structures on the accuracy of the recovered model parameters inferred using the BAO approach. Applying the aforementioned procedure of the BAO approach mentioned before, the measured magnetic anomaly of the two neighboring models is given in Fig. 9a. The obtained average loudness and emission rate of the bat of the composite anomaly are shown in Fig. 9b and c, respectively. The NRMSE of the global best solution (Ω) is shown in Fig. 9d, and the average NRMSE of all the bats is shown in Fig. 9e. Table 7 shows  www.nature.com/scientificreports/   www.nature.com/scientificreports/ the recovered model parameters of the two interference source models are semi-identical to the true ones. Also, Table 7 shows the RE of the recovered model parameters for each source model. The result explains that the BAO approach can give accurate results in the case of the presence of multiple sources.
To test the stability of the proposed BAO approach on multiple and surrounding structure effects, we have contaminated the composite magnetic anomaly response of Fig. 9a with two distinct forms of noise that were previously described as RGN and AWGN with 10% noise amounts (Fig. 10a). By applying the BAO approach  www.nature.com/scientificreports/ scheme to the noisy composite anomalies, the best obtained model parameter of the recovered models will be corresponding to the minimum NRMSE of the objective functions (Ω). Figure 10 shows the noisy contaminated composite magnetic anomaly of the two surrounded sources after adding the 10% RGN (I) and 10% AWGN (II) to the composite data shown in Fig. 9a, as well as the calculated magnetic response after obtaining the best model parameters using the BAO inversion approach (panel a). The loudness, emission rat, the NRMSE of the global best solution (Ω), and the average NRMSE of all the bats are shown in panels b, c, d, and e of Fig. 10, respectively. Tables 8 and 9 show the results of the recovered model parameters of the noisy composite magnetic anomaly for both the distinct noise forms (RGN and AWGN). The recovered model parameters of the two polluted source models are still in good coincidence with the actual ones. In addition, Tables 8 and 9 illustrate the RE corresponding to each obtained model parameter for each distinct noise form. As a result, it's reasonable to conclude that the BAO technique provided here is stable in the presence of the distinct noise forms that are being intruded into the modeled data.
Based on the numerical dataset examples presented above, it can be inferred that the BAO approach proposed here is accurate, stable, and appropriate for the interpretation of real magnetic data, as explained in the next section.   5], L = 1.0 and r = 0.9) that achieve the minimum NRMSE of the objective function and give a fast convergence to the optimum solution. The initial velocity (V i ) at position (X i ) was set to zero at the beginning of the inversion process. The search range is adopted to simulate more realistic cases where a priori information is absent. Therefore, the search space is chosen in both synthetic and real datasets based on the minimum NRMSE of the objective function (Ω) where the search range for the model parameters that will give the minimum Ω will be selected as the suitable search range.
Case-1: Galinge magnetic anomaly, Northwest, China. The Galinge iron ore deposit, located in the Qinghai region of northwest China, is one of the major skarn iron resources. The bedrock in the deposit is covered by broad and thick Quaternary (Q) gravel with thicknesses ranging from 117 to 210 m. The iron formation is mostly determined by the strata sequence, syngenetic breccia, volcanic, and subvolcanic rocks. The deposits' orebodies are mostly found in the lithological segments of the Ordovician Tanjianshan group (Fig. 11a). Skarnization and serpentinization are two significant wall-rock modifications that are strongly linked to mineralization. The principal ore minerals are magnetite and hematite, with minor quantities of siderite and hematite, and the average Fe grade is 37.16 percent. The Galinge iron ore deposit may have originated as a reformed and overlaid deposit as a result of volcanic emission and sedimentation [72][73][74] . The Quaternary gravel entirely covers the iron orebodies in this deposit. One of the most successful ways to discover magnetite deposits is through magnetic surveying. The total magnetic anomaly map reveals strong and regular magnetic anomalies with lengths and widths reaching 1200 and 500 m, respectively, with an ellipsoid form and extending northwest-southeast, with amplitudes over 1600 nT (Fig. 11b).
Over the Galinge magnetic anomaly map, we have two profiles AB (L212) and A'B' (L196) in the northeast direction (Fig. 11b) were subjected to interpretation using the BAO inversion approach. The profiles AB and A'B' are digitized using a sampling interval of 20 m with a total profile length of 1200 m and are appeared in Figs. 12a and 13a, respectively. Applying the procedure of the BAO approach scheme on the Galinge magnetic anomaly of both profiles AB and A'B' , the characteristics source parameters of the two anomalies can be estimated. Figures 12b,c and 13b,c show the average loudness and bat emission rate over the magnetic anomaly, respectively. As well, Figs. 12d,e and 13d,e show the NRMSE of the global best solution (Ω) and the average NRMSE of all the bats, respectively, of both anomalous profiles AB and A'B' . The best interpreted model parameters are corresponding to the minimum objective function (Ω). For anomaly profile AB (L212), the minimum value is 4.57 and the best recovered model parameters are [K = 1800 ± 408 nT, z = 185 ± 2.5 m, x o = 960 ± 7.89 m, θ = 70° ± 5.00, and d = 55 ± 4.08 m], which suggests that the effect of the profile AB of Galinge anomaly has resulted from 2D dipping dike-like structure. The observed and calculated magnetic anomalies are in good matching as shown in Fig. 12a as well as the obtained depth to the top is excellent compared with the depth inferred by drilling as shown in Fig. 14. For anomaly profile A'B' (L196), there are two distinct anomalies appear along the profile, the min Ω = 3.31 and the best recovered model parameters for the first anomaly are [K 1 = 250 ± 25.00 nT, z 1 = 150 ± 5.00 m, x o1 = 300 ± 3.75 m, θ 1 = 30° ± 2.49 and d 1 = 20 ± 0.50 m], and for the second anomaly are [K 2 = 1690 ± 5.00 nT, z 2 = 160 ± 5.01 m, x o2 = 935 ± 3.76 m, θ 2 = 55° ± 2.50 and d 2 = 27 ± 0.51 m], the results suggest that the effect of the profile A'B' of Galinge anomaly is due to two dipping dikes-like structure. The observed and calculated magnetic anomalies of the A'B' profile are well coincident as shown in Fig. 13a. In addition to the obtained depth to the top of the second anomaly is approved with drilling and is in excellent agreement with the depth to the top inferred by drilling as illustrated in Fig. 15.
The Galinge magnetic anomaly profiles AB and A'B' were interpreted by Liu et al. (2018) using the standard PSO inversion method with a depth ranging from 200 to 500 m for Profile AB and a depth ranging from 200 to 400 m for profile A'B' . The present study of the BAO approach interpreted the Galinge anomaly profiles AB and A'B' approximated by 2D dipping and vertical dikes with depth to the top of the ore deposits of 185 m and 160 m for the profiles AB and A'B' , respectively, which agree very well with the drilling information of the four boreholes ZK21204, ZK21203, ZK21201, and ZK21202 for the Galinge anomaly profile AB and the Table 9. Numerical Model-3: True and recovered model parameters of the noisy composite interference multiple structures after added 10% AWGN to the composite anomaly, and the corresponding RE. www.nature.com/scientificreports/ www.nature.com/scientificreports/ three boreholes ZK19601, ZK19603, and ZK19604 of the Galinge anomaly profile A'B' (Fig. 14b and Fig. 15b), respectively. In addition, the BAO approach has a good matching compared to the other published technique 75 ( Fig. 14a and 15a).

Model parameters
Case-2: Weigang magnetic anomaly, East, China. The Weigang iron ore deposits are discovered in the East of China, between the middle and lower sections of the Yangtze River's iron-copper metallogenic region. Silurian sandstone, Devonian quartz sandstone, Triassic limestone, and Cretaceous sandstone shale are some of the layers that have been exposed in the mining region. Late Yanshanian granodiorite porphyry, diorite porphyritic, and quartz diorite porphyry are the most important intrusive rocks (Fig. 16a). Weigang iron ore is a skarn-type magnetite deposit with ore bodies found in skarn contact zones between granodiorite porphyry, marble, and hornstone, which are considered high-temperature hydrothermal deposits generated by multiple mineralizations 76 . The vertical component (∆Z) of the magnetic anomaly of the Weigang region is depicted in www.nature.com/scientificreports/ Fig. 16b as a colored contour map. The magnetic anomaly is east-west, with amplitudes ranging from 1100 to 21,000 nanoteslas. The anomaly is around 1100 and 400 m long and wide. Two profiles are taken across the Weigang magnetic anomaly map, A1B1 (Line 5) and A2B2 (Line 6) in a roughly north-south direction (Fig. 16b) to investigate the iron ore-deposits in the region. The two profiles were subjected to interpretation using the BAO inversion approach. A 10-m sampling interval was used to digitize the two profiles A1B1 and A2B2 with the total length of 800 and 850 m as shown in Fig. 17a and Fig. 18a, respectively. Performing the BAO scheme on the Weigang magnetic anomaly of both profiles A1B1 and A2B2, the characteristics source parameters of the two anomalies can be obtained. Figures 17b,c and 18b,c show the average loudness and bat emission rate over the magnetic anomaly, respectively. In addition, Fig. 17d,e and Fig. 18d,e show the NRMSE of the global best solution (Ω), and the average NRMSE of all the bats, respectively, of both anomalous profiles A1B1 and A2B2.  www.nature.com/scientificreports/ The best recovered model parameters will be obtained when the optimal solution reaches the minimum of the objective function (Ω). For anomaly profile A1B1 (Line 5), the min Ω = 3.29 and the best recovered model parameters are [K = 710,000 ± 99.05 nT, z = 40 ± 2.00 m, x o = 490 ± 1.24 m, and θ = -17° ± 2.00], which suggests that the effect of the profile A1B1 of the Weigang anomaly results from the vertical dike-like structure. The observed and calculated magnetic anomalies are in good matching as shown in Fig. 17a and the obtained depth to the top is excellent compared with the depth inferred by drilling as shown in Fig. 19.  www.nature.com/scientificreports/ well coincident as shown in Fig. 18a. Moreover, the obtained depth to the top of the second anomaly is approved with drilling and is in excellent agreement with the depth to the top inferred by drilling as illustrated in Fig. 20. The Weigang magnetic anomaly profiles A1B1 and A2B2 have been interpreted also by Liu et al. 75 using the standard PSO inversion method. The Weigang anomaly A1B1 profile (Line 5) was interpreted as a semi-vertical dike with a depth to the top of about 50 m and extended to 500 m. While the Weigang anomaly A2B2 profile (Line 6) was interpreted as a nearly vertical dike with a depth range from 100 to 400 m. The suggested BAO approach interpreted the Weigang anomaly profiles A1B1 and A2B2 approximated by vertical dikes with depth to the top of the ore deposits of 50 and 40 m for the profiles A1B1 and A2B2, respectively, which has good matching with   77 . In general, sedimentary and meta-volcanic rocks cover the Hamrawein region (Fig. 21), and the detected magnetic anomaly is made up of two primary anomalies (63,64). The magnetic anomaly's profile AB was taken in the northeast over the total intensity map of Hamrawein (Fig. 22) to investigate the metavolcanic basalt rocks using the BAO approach. The Hamrawein anomaly profile AB with a length of 17,800 m and is digitized at 200-m sampling intervals (Fig. 23a). www.nature.com/scientificreports/ Following the procedures of the BAO approach, the loudness, emission rate, the NRMSE of the global best solution (Ω), and the average NRMSE of all the bats are shown in Fig. 23b-e, respectively. The best interpretive model parameters are corresponding to the min (Ω). The min (Ω) is 4.29 and the best recovered model parameters for the first anomaly are [K 1 = 103,000 ± 1500.00 nT, z 1 = 570 ± 0.99 m, x o1 = 4550 ± 35.41 m, and θ 1 = 65° ± 10.00], and for the second anomaly are [K 2 = 65,800 ± 100.00 nT, z 2 = 470 ± 1.01 m, x o2 = 15,200 ± 35.50 m, and θ 2 = -50° ± 5.00], the results recommended that the two distinct anomalies of the Hamrawein profile AB is due to presence two vertical dikes-like structure. The observed and calculated magnetic anomalies of the Hamrawein profile AB have outstanding matching (Fig. 23a). Table 10 shows a comparison of the results achieved by the current method with those acquired by other published approaches 78  www.nature.com/scientificreports/ gradient (TG) method with depths of z o1 = 486.5 m and z o2 = 440.4 m to explain the Hamrawein anomaly. Essa and Elhussein (2018) evaluate these anomalies by utilizing the particle swarm optimization (PSO) (z o1 = 623.05 m and z o2 = 494.14 m). Mehanee et al. 19 interpreted the Hamrawein anomaly using the R-parameter technique and obtained the depths of the two-structures (z o1 = 480 m and z o2 = 440 m). We can be concluded that the depths obtained by the proposed technique (z o1 = 570 m and z o2 = 470 m) correspond well with those reported in the literature. In addition, Fig. 24 shows that the suggested BAO technique has a better matching than Mehanee et al. 19 with observed data (Fig. 24a), as well as the subsurface expected modeling of the Hamrawein anomaly using the BAO approach (Fig. 24b).

Conclusions
In magnetic interpretation, determining the appropriate buried model for describing subsurface structures is critical. To analyze magnetic data, a global Bat algorithm optimization technique (BAO) was used to obtain the suitable model parameters (best model). After attaining the global best solution, the best-interpreted model www.nature.com/scientificreports/ parameters (amplitude coefficient, depth, source location, width, and index parameter angle) are executed. The BAO's designed inversion technique is simple, fast, accurate, and straightforward to apply to various magnetic datasets and does not require a priori information. Furthermore, it is capable effectively of handling the multimodels issue. Moreover, the efficiency and accuracy of the suggested method have been confirmed on numerical datasets with different types of noise (RGN and AWGN) and amounts (10%, 15% and 20%). Finally, the BAO approach is fruitfully utilized in three different real cases from China and Egypt for ore deposits exploration and metavolcanics rock investigations.

Data availability
The authors declare that the data is available upon request.